#include<bits/stdc++.h>
using namespace std;

int n;
string path;
struct Node{
    string name;
    unordered_map<string,Node*> mp;
    Node(){}
    Node(string name){this->name=name;}
};
int sum=0;

int main()
{
    cin>>n;
    Node* root = new Node{""};
    for(int i=1;i<=n;i++)
    {
        cin>>path;
        vector<string> dics;
        char c;
        for(int i=0;path[i]!='\0';)
        {
            if(path[i]=='/'){
                string tmp;
                int j=i+1;
                while(path[j]!='/'&&path[j]!='\0')
                {
                    tmp+=path[j];
                    j++;
                }
                i=j;
                dics.emplace_back(tmp);
            }
        }
        Node* cur = root;
        for(auto dic:dics)
        {
            if( (cur->mp).count(dic))
            {
                cur = (cur->mp)[dic];
            }
            else{
                sum++;
                Node* ndic = new Node{dic};
                (cur->mp)[dic] = ndic;
                cur = ndic;
            }
        }
        cout<<sum<<endl;
    }
    return 0;
}